package com.mc.mcdubbo.main;

import com.mc.mcdubbo.config.McUtil;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {



    public static void main(String[] args) {
        // 用我们的配置文件来启动一个 ApplicationContext
        ApplicationContext context = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");

        BeanFactory parentBeanFactory = context.getParentBeanFactory();

        System.out.println("context 启动成功");

        context.getAutowireCapableBeanFactory();

        // 从 context 中取出我们的 Bean，而不是用 new MessageServiceImpl() 这种方式
        McUtil messageService = context.getBean(McUtil.class);
        // 这句将输出: hello world
        messageService.Test();

    }
}